import 'package:flutter/material.dart';
import 'package:flutter_changeroot_demo/pages/authService.dart';
import 'package:flutter_changeroot_demo/pages/fristPage.dart';
import 'package:flutter_changeroot_demo/pages/homePage.dart';
import 'package:flutter_changeroot_demo/pages/loginPage.dart';

AuthService appAuth = AuthService();

void main() async {
  Widget _defaultHome = LoginPage();

  bool _result = await appAuth.login();
  if (_result) {
    _defaultHome = FristPage();
  }
  runApp(MaterialApp(
    title: 'App',
    home: _defaultHome,
    routes: <String, WidgetBuilder>{
      '/home': (BuildContext context) => HomePage(),
      '/login': (BuildContext context) => LoginPage(),
      '/frist': (BuildContext context) => FristPage()
    },
  ));
}
